import request from '@/utils/request'
// 获取组织架构数据
export function getDepartments(id) {
    return request({
        method: "GET",
        url: id ? '/company/department/' + id : '/company/department'
    })
}
// 删除部门
export function deleteDepartments(id) {
    return request({
        url: `/company/department/${id}`,
        method: "DELETE"
    })
}

// 添加部门
export function addDepartments(data) {
    return request({
        url: `/company/department`,
        method: "POST",
        data
    })
}
// 修改部门
export function editDepartments(params) {
    return request({
        url: `/company/department`,
        method: "PUT",
        params
    })
}